<template>
  <view>
    <view class="top tac fw">
      <text>填写驳回信息</text>
    </view>
    <view class="messageBar fz12">
      <u-form>
      <u-form-item
          label="原因"
          prop="remark"
          borderBottom
          ref="item1"
      >
        <u--textarea
            v-model="fromData.remark"
            disabledColor="#ffffff"
            placeholder="请输入驳回原因"
        ></u--textarea>
      </u-form-item>
      </u-form>
    </view>

    <view class="upBtn tac colorf" @click="rejectSub">提交</view>
  </view>
</template>

<script>
import UTextarea from "../../uni_modules/uview-ui/components/u--textarea/u--textarea.vue";
import {updateApplicationAudit} from "../../api/order.js"
export default {
  components: {UTextarea},
  data() {
    return {
        fromData:{
          orderId: '',
          remark:'',
        },
    };
  },
  onLoad(option) {
    console.log(option);
    this.fromData.orderId = option.id
  },
  methods:{
     rejectSub(){
       updateApplicationAudit(this.fromData).then(res => {
         if (res.code == 0){
           this.$u.toast('订单已驳回')
           setTimeout(()=>{
             uni.navigateBack()
           },500)
         }else {
           uni.$u.toast('驳回失败')
         }
       })
    }
  }
}
</script>

<style lang="scss">
.top{
  line-height: 80rpx;
  background-color: #eaf3ff;
}
.messageBar{
  min-height: 80rpx;
  line-height: 80rpx;
  padding: 0 30rpx;
  margin-bottom: 10rpx;
  background-color: #fff;
  .select{
    image{
      width: 20rpx;
      height: 30rpx;
      margin-left: 10rpx;
    }
    .input{
      width: 100rpx;
    }
  }
  .btn{
    width: 150rpx;
    line-height: 60rpx;
    margin-right: 10rpx;
    border-radius: 30rpx;
    background-color: #ccc;
  }
}
.upBtn{
  width: 80%;
  line-height: 80rpx;
  border-radius: 40rpx;
  background-color: #0055ff;
  margin: 40rpx auto 20rpx;
}
</style>